package com.study.service;

import com.study.dao.UserDAO;
import com.study.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService implements UserDAO {

    @Autowired
    private UserDAO userDAO;



    @Override
    public User login(User user) {

        User userDB = userDAO.login(user);
        if(userDB != null){
            return userDB;
        }

        throw new RuntimeException("登入失败");
    }
}
